package com.huazi.www.yang.login.service.Imlp;

import com.huazi.www.yang.login.dao.DocdorLoginDao;
import com.huazi.www.yang.login.dao.Impl.DocdorLoginDaoImpl;
import com.huazi.www.yang.login.entity.DoctorLogin;
import com.huazi.www.yang.login.service.DocdorLoginService;

public class DocdorLoginServiceImpl implements DocdorLoginService {
    DocdorLoginDao dao = new DocdorLoginDaoImpl();

    /**
     * 医生登录
     *
     * @param docdorId 医生id
     * @param pwd      密码
     * @return
     */
    @Override
    public boolean login(String docdorId, String pwd) {
        int login = dao.login(docdorId, pwd);
        if (login == 1) {
            return true;
        }
        return false;
    }

    /**
     * 验证是否正确
     *
     * @param doctorId
     * @param doctorcard
     * @return
     */
    @Override
    public boolean forgetPwd(String doctorId, String doctorcard) {
        int count = dao.forgetPwd(doctorId, doctorcard);
        if (count == 1) {
            return true;
        }
        return false;
    }

    @Override
    public void updatePwd(String doctorId, String pwd) {
        dao.updatePwd(doctorId, pwd);
    }

    @Override
    public DoctorLogin doctor(String id) {
        return dao.doctor(id);
    }
}
